export default function(sequelize, DataTypes) {
  return sequelize.define('user_add_msg', {
    _sender_account: {
      type: DataTypes.STRING(15),
      allowNull: false,
      primaryKey: true
    },
    _receiver_account: {
      type: DataTypes.STRING(15),
      allowNull: false,
      primaryKey: true
    },
    _send_message: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "备注消息"
    },
    _send_timestamp: {
      type: DataTypes.STRING(15),
      allowNull: false,
      primaryKey: true
    },
    _sender_remark: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "好友备注"
    },
    _add_type: {
      type: DataTypes.BOOLEAN,
      allowNull: false,
      defaultValue: 0,
      comment: "0好友添加1群聊添加"
    },
    _session_id: {
      type: DataTypes.STRING(200),
      allowNull: true,
      comment: "群聊id"
    },
    _result: {
      type: DataTypes.BOOLEAN,
      allowNull: false,
      comment: "0待处理 1同意 2拒绝"
    }
  }, {
    sequelize,
    tableName: 'user_add_msg',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "_sender_account" },
          { name: "_receiver_account" },
          { name: "_send_timestamp" },
        ]
      }
    ]
  });
};
